<script language="javascript">
	function back(){
		document.location="<?php echo site_url(); ?>/master_dosen";
	}
</script>
<?php
echo form_open("/master_dosen/form_dosen/".$parameter, array("name"=>"form_dosen","id"=>"medic_form"));
if($parameter == FALSE){
	$kelas	= set_value("kelas");
	$nip	= set_value("nip");
	$nama	= set_value("nama");
} else {
	$kelas	= $value["ID_KELAS"];
	$nip	= $value["NIP"];
	$nama	= $value["NAMA_DOSEN"];
}
?>
<p>
	<label>NIM</label>
	<input type="text" name="nip" value="<?php echo $nip; ?>">
	<?php echo form_error("nip"); ?>
</p>
<p>
	<label>Nama Dosen</label>
	<input type="text" name="nama" value="<?php echo $nama; ?>">
	<?php echo form_error("nama"); ?>
</p>
<p id="role">
	<label>Nama Kelas</label>
	<select name="kelas">
		<option value="">-- Pilih Nama Kelas --</option>
		<?php
		foreach($qkelas as $row){
		?>
		<option value="<?php echo $row["ID_KELAS"]; ?>" <?php echo ($kelas == $row["ID_KELAS"]) ? ("selected") : (""); ?>><?php echo $row["NAMA_PROGRAM"] . " " . $row["NAMA_JURUSAN"] . " " . $row["NAMA_KELAS"]; ?></option>
		<?php
		}
		?>
	</select>
	<?php echo form_error("kelas"); ?>
</p>
<p>
	<input type="submit" class="btn btn-primary" id="submit" value="Simpan">
	<input type="reset" class="btn btn-primary" id="submit" value="Reset">
	<input type="button" class="btn btn-primary" id="submit" value="Kembali" onClick="back()">
</p>
<?php echo form_close(); ?>